
from selenium import webdriver
from selenium.webdriver.common.by import By

browser = webdriver.Firefox()
url = 'https://www.baidu.com/'
browser.get(url)


btn = browser.find_element(By.ID,'su')

btn_class_name = btn.get_attribute('class')
print(btn_class_name)  # bg s_btn

btn_tag_name = btn.tag_name
print(btn_tag_name) # input

a_link = browser.find_element(By.LINK_TEXT,'新闻')
print(a_link.text)   # 新闻


